<script setup>
import {reactive, ref,onMounted} from 'vue'
import {get,post}  from '@/myaxios'
import { User, Lock } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import router from '@/router'


const menuData  = reactive({menuList:[]})


onMounted(()=>{
    if(sessionStorage.loginUserMenus){
        console.log(JSON.parse(sessionStorage.loginUserMenus));
        menuData.menuList = JSON.parse(sessionStorage.loginUserMenus)
    } 
})

</script>

<template>
        <el-menu router active-text-color="#626aef" background-color="#FAFAFA" text-color="#606266" default-active="2">
                <el-sub-menu v-for=" menu in menuData.menuList" :index="menu.mid+''">
                    <template #title>
                        <el-icon><component :is="menu.glyphicon"/></el-icon>
                        <span>{{menu.menuname}}</span>
                    </template>
                    <el-menu-item v-for="subm in menu.subMenu" :index="subm.url">
                        <el-icon><component :is="subm.glyphicon"/></el-icon>
                        <span>{{subm.menuname}}</span>
                    </el-menu-item>
                    
                </el-sub-menu>


            </el-menu>



</template>

<style scoped>

</style>